package com.ymx.darling.session.setting.relation;

import java.util.List;

/**
 * xml的Relation节点数据
 * @author 爱Java的小于
 */
public class RelationNode {
    private final String fieldName;
    private final int depth;
    private final List<RelationNode> nodeList;

    public RelationNode(String fieldName, int depth, List<RelationNode> nodeList) {
        this.depth = depth;
        this.nodeList = nodeList;
        this.fieldName = fieldName;
    }

    public String getFieldName() {
        return fieldName;
    }

    public int getDepth() {
        return depth;
    }

    public boolean hasDepth() {
        return this.depth != 1;
    }

    public boolean hasNode() {
        return !this.nodeList.isEmpty();
    }

    public List<RelationNode> getNodeList() {
        return nodeList;
    }
}
